<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CANopenNode: Object Dictionary function</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CANopenNode
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__CO__SDO__OD__function.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Object Dictionary function<div class="ingroups"><a class="el" href="group__CO__CANopen__301.html">CANopen_301</a> &raquo; <a class="el" href="group__CO__SDOserver.html">SDO server</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Optional application specific function, which may manipulate data downloaded or uploaded via SDO.  
<a href="#details">More...</a></p>
<p>Optional application specific function, which may manipulate data downloaded or uploaded via SDO. </p>
<p>Object dictionary function is external function defined by application or by other stack files. It may be registered for specific Object dictionary entry (with specific index). If it is registered, it is called (through function pointer) from SDO server. It may verify and manipulate data during SDO transfer. Object dictionary function can be registered by function <a class="el" href="group__CO__SDOserver.html#gab433430abe125bb16c08e7be3e034985" title="Configure additional functionality to one Object dictionary entry. ">CO_OD_configure()</a>.</p>
<h4>SDO download (writing to Object dictionary)</h4>
<p>After SDO client transfers data to the server, data are stored in internal buffer. If data contains multibyte variable and processor is big endian, then data bytes are swapped. Object dictionary function is called if registered. Data may be verified and manipulated inside that function. After function exits, data are copied to location as specified in <a class="el" href="structCO__OD__entry__t.html" title="Object for one entry with specific index in Object dictionary. ">CO_OD_entry_t</a>.</p>
<h4>SDO upload (reading from Object dictionary)</h4>
<p>Before start of SDO upload, data are read from Object dictionary into internal buffer. If necessary, bytes are swapped. Object dictionary function is called if registered. Data may be manipulated inside that function. After function exits, data are transferred via SDO server.</p>
<h4>Domain data type</h4>
<p>If data type is domain, then length is not specified by Object dictionary. In that case Object dictionary function must be used. In case of download it must store the data in own location. In case of upload it must write the data (maximum size is specified by length) into data buffer and specify actual length. With domain data type it is possible to transfer data, which are longer than <a class="el" href="group__CO__STACK__CONFIG.html#ga905cec21ba3e315a652dad23c3595a16" title="Size of the internal data buffer for the SDO server. ">CO_CONFIG_SDO_BUFFER_SIZE</a>. In that case Object dictionary function is called multiple times between SDO transfer.</p>
<h4>Parameter to function:</h4>
<p>ODF_arg - Pointer to <a class="el" href="structCO__ODF__arg__t.html" title="Object contains all information about the object being transferred by SDO server. ...">CO_ODF_arg_t</a> object filled before function call.</p>
<h4>Return from function:</h4>
<ul>
<li>0: Data transfer is successful</li>
<li>Different than 0: Failure. See <a class="el" href="group__CO__SDOserver.html#ga7587ddcf798747fe6d97d03bf1bf2979" title="SDO abort codes. ">CO_SDO_abortCode_t</a>. </li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Tue Jun 9 2020 17:29:32 for CANopenNode by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
